@extends('admin/layouts.default')

{{-- Web site Title --}}
@section('title')
Edit Brank ::
@parent
@stop

{{-- Content --}}
@section('content')
<div class="page-header">
    <h3>
        Edit Brache of <b class="text-info">{{ $branch->place->name}}</b> in <b class="text-info">{{$branch->province->name}}</b>

        <div class="pull-right">
            <a href="{{{ URL::to('admin/branches') }}}" class="btn btn-small btn-inverse"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
        </div>
    </h3>
</div>

<!-- Tabs -->
<ul class="nav nav-tabs">
    <li class="active"><a href="#tab-general" data-toggle="tab">General</a></li>
    <li><a href="#tab-media" data-toggle="tab">Media</a></li>
</ul>
<!-- ./ tabs -->

<form class="form-horizontal custom-xlarge" method="post" action="" autocomplete="off" enctype="multipart/form-data">
     <!-- CSRF Token -->
    <input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
    <!-- ./ csrf token -->

    <div class="tab-content">
        <!-- General tab -->
        <div class="tab-pane active" id="tab-general">
            <!-- Branch Name -->
            <div class="control-group {{{ $errors->has('branch_name') ? 'error' : '' }}}">
                <label class="control-label" for="title">Name</label>
                <div class="controls">
                    <input type="text" name="branch_name" id="title" class="span10" value="{{{ Input::old('branch_name', $branch->branch_name) }}}" />
                    {{ $errors->first('branch_name', '<span class="help-inline">:message</span>') }}
                </div>
            </div>
            <!-- ./ Branch name -->

            <div class="control-group">
                <label class="control-label" for="house">Address</label>
                <div class="controls">
                    <input type="text" name="house" placeholder="House" class="input-medium" value="{{{ Input::old('house', $branch->house) }}}" />
                    <input type="text" name="street" placeholder="Street" class="input-medium" value="{{{ Input::old('street', $branch->street) }}}" />
                </div>
            </div>

            <div class="control-group">
                <label class="control-label" for="commune">Commune/ Sangkat</label>
                <div class="controls">
                    <input type="text" name="commune" id="commune" class="input-xlarge" value="{{{ Input::old('sangkat', $branch->sangkat) }}}" />

                </div>
            </div>

            <div class="control-group">
                <label class="control-label" for="khan">District / Khan</label>
                <div class="controls">
                    <input type="text" name="khan" id="khan" class="input-xlarge" value="{{{ Input::old('khan', $branch->khan) }}}" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="phone">Phone</label>
                <div class="controls">
                    <input type="text" name="phone" id="phone" class="input-xlarge" value="{{{ Input::old('phone', $branch->phone) }}}" />
                </div>
            </div>

            <div class="control-group {{{ $errors->has('email') ? 'error' : '' }}}">
                <label class="control-label" for="email">Email</label>
                <div class="controls">
                    <input type="text" name="email" id="email" class="input-xlarge" value="{{{ Input::old('email', $branch->email) }}}" />
                    {{ $errors->first('email', '<span class="help-inline">:message</span>') }}
                </div>
            </div>

            <div class="control-group {{{ $errors->has('website') ? 'error' : '' }}}">
                <label class="control-label" for="website">Website</label>
                <div class="controls">
                    <input type="text" name="website" id="website" class="input-xlarge" value="{{{ Input::old('website', $branch->website) }}}" />
                    {{ $errors->first('website', '<span class="help-inline">:message</span>') }}
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Maps</label>
                <div class="controls">
                    <input type="text" name="lat" id="title" class="input-medium" placeholder="lattitude" value="{{{ Input::old('lat', $branch->lat) }}}" />
                    <input type="text" name="lng" id="title" class="input-medium" placeholder="longtitude"value="{{{ Input::old('lng', $branch->lng) }}}" />
                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-media">
            <div class="control-group {{{ $errors->has('branch_logo') ? 'error' : '' }}}">
                <label class="control-label" for="branch_logo">Logo</label>
                <div class="controls">
                    <input type="text" name="branch_logo" id="branch_logo" class="input-xlarge" value="{{{ $branch->branch_logo }}}" />
                    {{ $errors->first('branch_logo', '<span class="help-inline">:message</span>') }}
                </div>
            </div>

            <div class="control-group {{{ $errors->has('branch_logo') ? 'error' : '' }}}">
                <label class="control-label" for="content">Image</label>
                <div class="controls">
                    <div><img src="/uploads/images/branches/thumb/{{{ $branch->branch_logo }}}" alt="{{{ $branch->branch_name }}}"/>
                    </div>
                     <input type="file" name="image"/>
                      {{ $errors->first('branch_logo', '<span class="help-inline">:message</span>') }}
                </div>
            </div>
        </div>
    </div>
    <!-- Form Actions -->
    <div class="control-group">
        <div class="controls">
            <a class="btn btn-link" href="{{{ URL::to('admin/branchs') }}}">Cancel</a>
            <button type="submit" class="btn btn-success">Update</button>
        </div>
    </div>
</form>
@stop
